try:
    gender = input('请输入性别：')
    if gender!='男'and gender!='女':
        raise ValueError('性别只能是男或女')
    else:
        print('你的性别是',gender)
except Exception as e:
    print(e)
